import 'package:demo/pages/home_editor/home_editor_cubit.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_htmlful/Div.dart';
import 'package:flutter_htmlful/Style.dart' as DivStyle;
// import 'package:flutter_quill/flutter_quill.dart';

class HomeEditorPage extends StatefulWidget {
  const HomeEditorPage({super.key});

  @override
  State<HomeEditorPage> createState() => _HomeEditorPageState();
}

class _HomeEditorPageState extends State<HomeEditorPage> {
  // final QuillController _controller = QuillController.basic();

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => HomeEditorCubit(),
      child: BlocBuilder<HomeEditorCubit, HomeEditorState>(
        builder: (BuildContext context, HomeEditorState state) {
          return SafeArea(
            child: Div(
              style: DivStyle.Style(
                backgroundColor: Colors.white,
              ),
              body: [
                // QuillToolbar.simple(
                //   configurations: QuillSimpleToolbarConfigurations(
                //     controller: _controller,
                //     sharedConfigurations: const QuillSharedConfigurations(
                //       locale: Locale('zh'),
                //     ),
                //   ),
                // ),
                // Div(
                //   body: QuillEditor.basic(
                //     configurations: QuillEditorConfigurations(
                //       controller: _controller,
                //       readOnly: false,
                //       sharedConfigurations: const QuillSharedConfigurations(
                //         locale: Locale('zh'),
                //       ),
                //     ),
                //   ),
                //   style: DivStyle.Style(
                //     flexGrow: 1,
                //   ),
                // ),
                ElevatedButton(
                  onPressed: () {},
                  child: Text('发送'),
                ),
              ],
            ),
          );
        },
      ),
    );
  }
}
